Skip to content

Conversation

@adamfweidman
Copy link
Collaborator

@adamfweidman adamfweidman commented Dec 22, 2025

Summary

This PR enables the discovery and registration of remote agents (via A2A) defined in TOML files. It also introduces support for defining multiple remote agents within a single TOML file using the [[remote_agents]] array syntax.

Details

  • Remote Agent Support: Implemented schema validation for agents defined with an agent_card_url.
  • Multi-Agent Config: Added support for [[remote_agents]] blocks to define multiple remote agents in
    one file.
  • Flexible Syntax:
    • description is optional for remote agents (defaults to a placeholder).
    • kind defaults to "remote" and can be omitted within [[remote_agents]] blocks.

Related Issues

Fixes: #15094

How to Validate

  • Enabled experimental agents with "experimental": { "enableAgents": true } in your settings.json
  • Add
kind = "remote"
name = "remote-tester"
description = "A remote testing agent (A2A)"
agent_card_url = "https://example.com/agent-card.json"

to .gemini/agents/remote-agent-example.toml

  • run npm run start -- --debug and confirm AgentRegistry] Registered remote agent 'remote-tester'... appears in debug console

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@adamfweidman adamfweidman requested a review from a team as a code owner December 22, 2025 19:26
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @adamfweidman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the agent management system by introducing support for remote agents and allowing the definition of multiple agents within a single TOML configuration file. These changes provide greater flexibility in how agents are discovered, registered, and configured, paving the way for more dynamic and scalable agent-based applications.

Highlights

  • Remote Agent Support: Introduced the capability to define and register remote agents using TOML files, enabling discovery via A2A (Agent-to-Agent) communication.
  • Multi-Agent TOML Files: Added support for defining multiple agents within a single TOML file using the [[agents]] array syntax, streamlining configuration.
  • TOML Parsing Enhancements: Refactored the TOML loader to differentiate between local and remote agent definitions, validate remote agent properties like agent_card_url, and parse multiple agent entries from a single file.
  • Debug Logging for Remote Agents: Implemented debug logging within the AgentRegistry to provide visibility when remote agents are successfully registered, including their associated agent card URL.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for remote agents and defining multiple agents within a single TOML file. The changes are well-structured, introducing new Zod schemas for validation and updating the TOML loading logic to handle both single and multiple agent definitions. The addition of tests for the new functionality is also good. I've found one potential issue regarding the Zod schema validation that could lead to user confusion, which I've detailed in a specific comment. Otherwise, the implementation looks solid.

@github-actions
Copy link

github-actions bot commented Dec 22, 2025

Size Change: +2.41 kB (+0.01%)

Total Size: 22 MB

Filename Size Change
./bundle/gemini.js 22 MB +2.41 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

@adamfweidman
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for remote agents and defining multiple agents within a single TOML file. A high-severity Server-Side Request Forgery (SSRF) vulnerability has been identified due to insufficient validation of the agent_card_url in remote agent definitions, which could allow an attacker to scan internal networks or access sensitive cloud metadata. Stricter URL validation is recommended to mitigate this risk. Additionally, while the changes are well-structured and use Zod for validation, consider improving the accuracy of the TypeScript type definitions to better match post-validation data structures for enhanced type safety.

@adamfweidman adamfweidman force-pushed the remote-agent-toml branch 3 times, most recently from 1c19613 to 3c8e39a Compare December 23, 2025 16:33
@adamfweidman
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for remote agents and multi-agent TOML files, which is a great enhancement. The implementation is well-structured with clear separation of concerns using new types and Zod schemas for validation. The accompanying tests are thorough and cover the new functionality well. I have one suggestion to improve the robustness of the TOML parsing logic for single-agent files to make it more user-friendly. Additionally, there's a minor discrepancy in the pull request description regarding the TOML key for multi-agent files ([[agents]] vs. [[remote_agents]] in code), which might be worth clarifying.

@adamfweidman
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces excellent new functionality for defining remote agents and multiple agents within a single TOML file. The implementation is robust, leveraging Zod for schema validation and providing clear error messages. The accompanying tests are thorough and cover the new features and edge cases well. I have one suggestion to improve the maintainability of the error formatting logic to make it more resilient to future refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] Add RemoteAgent toml parsing and validation support

1 participant